<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">
cheakInfo();
var   cardNo="";//一卡通卡号
var   balance="";//一卡通余额
var  isOnlyCard="";
var  isDoctor="";
var  isOnlyLocal="";
var  clinicNo="";
var  isFee=0;//
var  ordersIds="";
var orderIds = new Array();
//
$(function () {
       $.ajaxSetup({ cache: false });
       isOnlyCard=$("#isOnlyCard").val();
       isDoctor=$("#isDoctor").val();
       isOnlyLocal=$("#isOnlyLocal").val();
       clinicNo=$("#clinicNo1").val();
    if(isOnlyCard=="true"){
        $("#clinicNo").attr("disabled","disabled");
        $("#name").attr("disabled","disabled");
        $("#age").attr("disabled","disabled");
        $("#sex").attr("disabled","disabled");
        $("#chargeT").attr("disabled","disabled");
        $("#medicalInsurance").hide();
        $("#readFee").hide();
    }else{
        $("#readCard").hide();
        isFee=1;
    }
    //读一卡通
    $("#readCard").on("click",function(){
        commonRead('0');
    })
     //读卡收费
    $("#readFee").on('click',function(){
         isOnlyCard="true";
         commonRead('1');
    })
    $("#branchDept").attr("checked","checked");
    // 准备上传数据
    $("#prepareData").on("click",function(){
        var isLocal=judgeIsLocal($("#clinicNo").val());//
        if(isLocal){
            var clinicOrders = $("#contentTable input[name=clinicOrdersId]:checked");
            if (clinicOrders.length <= 0) {
                toastr.error("请选择收费项目！");
                return;
            }
            var ordersIds=new Array();
            $("#contentTable tr").each(function () {
                var chk = $(this).find('td').eq(0).find('input');
                if (chk.prop("checked")) {
                    var orderId = $(this).find('td').eq(0).find('input').val();
                    ordersIds.push(orderId);
                }
            });
            ordersIds.push($("#clinicNo").val());
            InParams("divide",ordersIds);
        }else{
            toastr.error("不能进行报销!本医院不是此人的定点医疗机构！");
            return false;
        }
    })

})
   //医保上传数据
    $("#medicalInsurance").on("click",function(){
        var clinicOrders = $("#contentTable input[name=clinicOrdersId]:checked");
        if (clinicOrders.length <= 0) {
            toastr.error("请选择收费项目！");
            return;
        }
        var ordersIds=new Array();
        $("#contentTable tr").each(function () {
            var chk = $(this).find('td').eq(0).find('input');
            if (chk.prop("checked")) {
                var orderId = $(this).find('td').eq(0).find('input').val();
                ordersIds.push(orderId);
            }
        });
        reimbursement("divide",ordersIds,$("#clinicNo").val());
    })
    //保存医保上传数据
    function reimbursement(functionName,inParams,clinicNo){
        $.ajax({
            type: "POST",
            url: "${ctx}/finance/medicalInsurance/save?functionName="+functionName+"&inParams="+inParams+"&clinicNo="+clinicNo,
            dataType: "json",
            success: function(data) { // data 保存提交后返回的数据，一般为 json 数据
                if (data.code == "success") {
                    $("#medicalInsuranceReceiptValue").val(inParams);
                    $("#serialNo").val(data.data);
                    toastr.success("上传成功");
                    return;
                }  else {
                    toastr.error(data.data);
                }
            },
            error: function (data) {

            }
        });
    }
//医保上传成功回写数据
function medicalValue(type){
    var clinicOrders = $("#contentTable input[name=clinicOrdersId]:checked");
    if (clinicOrders.length <= 0) {
        toastr.error("请选择收费项目！");
        return;
    }
    var ordersIds=new Array();
    var clinicOrders = $("#contentTable input[name=clinicOrdersId]:checked");
    var ordersIds=new Array();
    $("#contentTable tr").each(function () {
        var chk = $(this).find('td').eq(0).find('input');
        if (chk.prop("checked")) {
            var orderId = $(this).find('td').eq(0).find('input').val();
            ordersIds.push(orderId);
        }
    });

    $.ajax({
        type: "POST",
        url: "${ctx}/finance/medicalInsurance/findRecordMaster?inParams="+ordersIds,
        dataType: "json",
        async:false,
        success: function(data) {
            if (data.code == "success") {
                $("#medicalCosts").val(data.data);
                $("#tongc").val(data.data);
//                toastr.success("调回成功");
                //charges(type);
            }  else {
                toastr.error(data.data);
            }
        },
        error: function (data) {
        }

    });
}

function commonRead(flag){
    cardNo=readOneCard();
    if(flag=='1'){
        clinicNo=$("#clinicNo").val();
    }
    if(!cardNo){
        toastr.error("读卡失败");
        return false;
    }else{
         loadSave(flag);
    }
 }
function page(n, s) {
    $("#pageNo").val(n);
    $("#pageSize").val(s);
    $("#patientInfo").submit();
    return false;
}
//触发事件
function cheakInfo(){
    $('#clinicNo').keydown(function (e) {
        if (e.keyCode == 13) {
            var clinicNo = $("#clinicNo").val();
            if (clinicNo != null && clinicNo != '') {
                loadDiv("chargeMaster",'${ctx}/finance/outpRcptMaster/findCharge?clinicNo=' + clinicNo);
            } else {
                toastr.warning("请输入门诊号进行查询");
            }
        }
    });
}

function loadSave(flag){
    $.ajax({
        type:"post",
        url:timestamp("${ctx}/med/medicalCardMaster/findByCardNo?cardNo="+cardNo),
        dataType:"json",
        async: false,
        cache:false,
        success:function(data){
           var patientId=$("#patientId").val();
           if(patientId!=data.patientId){
               toastr.error("此卡不是本人的卡或者是没有用卡进行挂号。");
           }else{
               toastr.success("读卡成功");
               returnOper(data,flag);
           }
         }
    })
}
function returnOper(data,flag){
    $("#balance").val(data.balance);
    if(isOnlyCard=="true"){
        $("#name").val(data.name);
        $("#age").val(data.age);
        $("#sex").val(data.sex=="2"?"男":"女");
        $("#clinicNo").val(clinicNo);
    }
    balance=data.balance;
    if(clinicNo){
        if (clinicNo != null && clinicNo != '') {
            if(flag=='0'){
                loadDiv("chargeMaster",timestamp('${ctx}/finance/outpRcptMaster/findCharge?clinicNo=' + clinicNo+"&onlyLocal="+isOnlyLocal));
            }
            if(flag=='1'){
                charges('1');
            }
        } else {
            toastr.warning("请输入门诊号进行查询");
        }
    }
}
//收费合计弹出框
function charges(type) {
    medicalValue();
    ordersIds="";
    var data =$("#tongc").val();
    var clinicOrders = $("#contentTable input[name=clinicOrdersId]:checked");
    if (clinicOrders.length <= 0) {
        toastr.error("请选择收费项目！");
        return;
    }
    var impentDept;
    var orderId;
    var totalChages = 0.0;
    var totalCosts =0.0;
    var checkTbable = "";
    var flag = true;
    var  performDept = $("input[name='performDept']:checked").val();
    $("#contentTable tr").each(function () {
        var chk = $(this).find('td').eq(0).find('input');
        if (chk.prop("checked")) {
            impentDept = $(this).find('td').eq(5).text();
            orderId = $(this).find('td').eq(0).find('input').val();
            orderIds.push(orderId);
            ordersIds+=orderId+",";
            totalCosts += Number($(this).find('td').eq(6).text());
            totalChages += Number($(this).find('td').eq(7).text());
            if(performDept=='0'){
                if (checkTbable == "") {
                    checkTbable = impentDept;
                }
                if (checkTbable != impentDept) {
                    toastr.error("您选择的是分科收费，请选择相同执行科室的项目进行收费");
                    flag = false;
                    return false;
                }
            }

        }
    });
    ordersIds=ordersIds.substring(0,ordersIds.length-1);
     if(isOnlyCard=="true"){
         var balance=$("#balance").val();
         if(totalCosts>balance){
             toastr.error("一卡通余额不足，请先充值：余额为"+balance);
             if(isFee==1){
                 isOnlyCard="false";
             }
             return false;
         }else{
             saveCharge(totalCosts,orderIds,'1');
             if(isFee==1){
                 isOnlyCard="false";
             }
             return false;
         }
    }
     if (flag&&type==0) {
        $("#totalCharges").val(totalCosts);
        $("#costs").val(totalChages);
         var serialNo = $("#serialNo").val();
         var tongc = $("#tongc").val();
         if(tongc!=null && tongc!='' && tongc>0){//医保统筹
             var cashMoney = totalCosts-tongc;//统筹支付后应该再付的现金金额
             $("#cashMoney").val(cashMoney);
             var moneyTypeDiv = $("#moneyType");
             var leftHtml = "";
             leftHtml += '<div class="form-group" id="addType">' +
             '<label class="col-sm-2 control-label" for="payType">支付类型：</label>' +
             '<div class="col-sm-3">' +
             '<select name="payType" id="payType' + 1 + '" class="form-control" data-parsley-required="true" readonly="true">' +
             <c:forEach items="${fns:getDictList('PAY_WAY_DICT')}" var="type">
             <c:choose>
             <c:when test="${type.label=='统筹支付'}">
             '<option value="${type.value}" selected="selected">${type.label}</option>' +
             </c:when>
             </c:choose>
             </c:forEach>
             '</select>' +
             '</div>' +
             '<label class="col-sm-2 control-label" for="payMoney">付款：</label>' +
             '<div class="col-sm-3">' +
             '<input type="number" class="form-control" value="'+tongc+'"  name="payMoney" id="payMoney" style="width: 120px;" readonly="true">' +
             '</div>' +
             '</div>';
             if(totalCosts>tongc){//如果应收金额大于统筹支付金额，追加其他支付方式
                 moneyTypeDiv.before(leftHtml);
                 giveChange();
             }else{//如果应收金额小于等于统筹支付金额，就统筹支付一个支付方式
                 moneyTypeDiv.html(leftHtml);
                 giveChange();
             }

         }
        total = layer.open({
            title: '合计',
            type: 1,
            area: ['40%', '80%'],
            content: $("#total"),
            btn: ['确定', '取消'],
            yes: function (index, layero) {
              /*  $(document).on('keydown', function(e){
                    if (e.keyCode == 13) {
                        saveCharge(totalChages, orderIds,'0',serialNo);
                        return;
                    }
                });*/
                saveCharge(totalChages, orderIds,'0',serialNo);
            },
            end:function (){
                $("#change").val("");
                $("#costsMon").val("");
                $("input[name=payMoney]").val("");
            }
        });
    }/*else{
        //移动支付
        $.ajax({
            type: 'get',
            url: '${ctx}/pay/mobilePay/createQrCode?price='+totalChages+"&orderIds="+orderIds,
            cache:false,
            success: function (data) {
                layer.open({
                    title: '支付二维码',
                    type: 1,
                    area: ['40%', '80%'],
                    content:data.image,
                    btn: ['确定', '取消'],
                    yes: function (index, layero) {
                        var tradeNo=data.tradeNo;//订单号
                        // if 支付成功  则会请求 notifyUrl ---（直接可以访问的连接，外网-不可以携带参数）

                    },
                    end:function (){
                        $("#change").val("");
                        $("#costsMon").val("");
                        $("input[name=payMoney]").val("");
                    }
                });
            }
        });

    }*/

}
//计算找零
function giveChange() {
    var totalMoney = 0.0;
    var change=0.0;
    $("input[name=payMoney]").each(function () {
        var money = $(this).val();
        totalMoney += Number(money);
        $("#costsMon").val(totalMoney);
    });
    var costs = $("#costs").val(); // 应收
//        var costsMon = $("#costsMon").val(); // 收款
    if (totalMoney == 0 || totalMoney == null) {
        toastr.error("收款金额不能为空");
        return false;
    }
     change+=Number((totalMoney - costs).toFixed(4));
    if (totalMoney < costs) {
        $("#change").val(change);
        toastr.error("收款金额小于应收金额，请重新收费");
        return false;
    } else {
        $("#change").val(change);
    }
}

//数据保存
function saveCharge(totalCharges, orderIds,cardPayFlag,serialNo) {
    var clinicNo = $("#clinicNo").val();
    var payType = "";
    var payMoney = "";
    var totalMoney = 0.0;
    var payTypes=$("select[name=payType]");
    if(cardPayFlag==0){
        for(var i=0;i<payTypes.length;i++){
            var type=$(payTypes[i]).val();
            payType+=type+",";
        }
        var payMoneys=$("input[name=payMoney]");
        for(var j=0;j<payMoneys.length;j++){
            var money = $(payMoneys[j]).val();
            totalMoney += Number(money);
//            payMoney.push(money);
            payMoney+=money+",";
        }
        if (totalMoney < totalCharges) {
            toastr.warning("实收费用小于应收费用，请重新收费");
            return;
        }
        payType=payType.substring(0,payType.length-1);
        payMoney=payMoney.substring(0,payMoney.length-1);
    }else{
        payType='3'
        payMoney=totalCharges;
        totalMoney=totalCharges;
        orderIds=ordersIds;
    }
    return false;
    $.ajax({
        type: 'post',
        url: '${ctx}/finance/outpRcptMaster/save',
        data:{cardPayFlag:cardPayFlag,cardNo:cardNo,costs:totalCharges,orderIds:ordersIds,payType:payType,payMoney:payMoney,totalMoney:totalMoney,serialNo:serialNo},
        cache:false,
        dataType:"json",
        success: function (data) {
            if (data.code == 'success') {
                toastr.success("收费成功");
                if(cardPayFlag==0){
                    layer.close(total);
                }
                var serialNo=data.data;
                printPdf(timestamp('${ctx}/finance/outpRcptMaster/printCharge'),'serialNo='+serialNo);
                loadDiv("chargeMaster",timestamp('${ctx}/finance/outpRcptMaster/findCharge?clinicNo=' + clinicNo));
                $("#detailChage").load(timestamp('${ctx}/finance/outpRcptMaster/findDetailCharge'));
                orderIds.length=0;
                ordersIds="";
                return;
            } else {
                toastr.error("收费失败");
                return;
            }
        }
    });
}
function selectedPayType(se,id){
    var payTypes=new Array();
    $("select[name=payType]").each(function(){
        if($(this).attr("id")!=id){
            payTypes.push($(this).val());
        }
    })
    alert(payTypes+"----"+$(se).val());
    if($.inArray($(se).val(), payTypes)!=-1){
        $(se).select2('val','')
        toastr.error("该收费类型已经存在不能重复输入");
    }

}
//添加支付类型
function addType(staus, i) {
    var idNum = $("select[name=payType]").length + 1;
    var leftHtml = "";
    leftHtml += '<div class="form-group" id="addType">' +
            '<label class="col-sm-2 control-label" for="payType">支付类型：</label>' +
            '<div class="col-sm-3">' +
            '<select name="payType"  onchange="selectedPayType(this,\'payType' + idNum + '\')"   id="payType' + idNum + '" class="form-control" data-parsley-required="true">'+
            '<option value="" selected="selected">请选择</option>' +
            <c:forEach items="${fns:getDictList('PAY_WAY_DICT')}" var="type">
            '<option value="${type.value}">${type.label}</option>' +
            </c:forEach>
            '</select>' +
            '</div>' +
            '<label class="col-sm-2 control-label" for="payMoney">付款：</label>' +
            '<div class="col-sm-3">' +
            '<input type="number" class="form-control" onchange="giveChange()" name="payMoney" id="payMoney" style="width: 120px;">' +
            '</div>' +
            '<i class="fa fa-minus" style="cursor: pointer" title="删除支付类型" onclick="addType(\'2\',this);"></i>' +
            '</div>';
    if (staus == '1') {
        $(i).parent().after(leftHtml);
        $("#payType" + idNum).select2();
    } else if (staus == '2') {
        $(i).parent().remove();
    }
    giveChange();
}
</script>

<div class="app bg-default">
    <section class="layout">
        <div class="content-wrap">
            <div class="row" id="topDivId">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-inline" id="patientInfo">
                                <label>门诊号 ：</label><input name="clinicNo" id="clinicNo" value="${clinicMaster.clinicNo}" class="form-control"
                                                           maxlength="100"/>&nbsp;&nbsp;
                                <label>姓名:</label><input name="name" value="${clinicMaster.name}" id="name" class="form-control" maxlength="100"/>&nbsp;&nbsp;
                                <label>性别:</label><input name="sex"  value="${clinicMaster.sex}" id="sex" class="form-control" maxlength="100"/>&nbsp;&nbsp;
                                <label>年龄：</label> <input name="age" value="${clinicMaster.age}" id="age" class="form-control" maxlength="100"/>&nbsp;&nbsp;
                                <label>费别：</label><input name="chargeType" value="${clinicMaster.chargeType}" id="chargeT"  class="form-control">
                                      <input type="hidden" value="${clinicMaster.chargeType}" id="chargeType">
                                &nbsp;&nbsp;<input type="radio" name="performDept" id="branchDept" value="0"> <label>分科</label>

                                <input type="radio" name="performDept" id="generalDept" value="1"> <label>全科</label>&nbsp;
                                &nbsp;<input id="readCard" class="btn btn-primary" type="button" value="读取一卡通"/>
                                &nbsp;<input id="btnSubmit" class="btn btn-primary" type="button" value="收费"
                                             onclick="charges(0);"/>
                                <input id="readFee" class="btn btn-primary" type="button" value="读卡收费"/>
                                <%--&nbsp;<input id="qrcode" class="btn btn-primary" type="button" value="扫码收费"  onclick="charges(1);"        />--%>
                               <%-- &nbsp;<input id="prepareData" class="btn btn-primary" type="button" value="上传费用"  />--%>
                                &nbsp;<input id="medicalInsurance" class="btn btn-info" type="button" value="医保上传"  />
                                <%--&nbsp;<input id="medicalInsuranceReceipt" class="btn btn-info" type="button" value="医保上传回调信息"  />--%>
                                &nbsp;<input id="medicalInsuranceReceiptValue" class="btn btn-info" type="hidden"/>
                                &nbsp;<input id="serialNo" class="btn btn-info" type="hidden"/>
                                &nbsp;<input id="medicalCosts" class="btn btn-info" type="hidden"/>
                             </form>
                        </div>
                    </section>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-6" id="chargeMaster">
                    <jsp:include page="chargeMaster.jsp"></jsp:include>
                </div>
                <div class="col-lg-6" id="detailChage">
                    <jsp:include page="chargeDetail.jsp"></jsp:include>
                </div>
            </div>
            <div id="total" style="display: none">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-horizontal" role="form">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="inputEmail3" class="col-sm-6 control-label">预交金额</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="inputEmail3" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="tongc" class="col-sm-6 control-label">统筹支付</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="tongc" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="danwei" class="col-sm-6 control-label">单位计价</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="danwei" value="0.00">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="zhanghu" class="col-sm-6 control-label">账户累计</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="zhanghu" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="zhifu" class="col-sm-6 control-label">账户支付</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="zhifu" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="yujiaojin" class="col-sm-6 control-label">预交金支付</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="yujiaojin" value="0.00">
                                        </div>

                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="zhanghuyu" class="col-sm-6 control-label">账户余额</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="zhanghuyu" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="gonwu" class="col-sm-6 control-label">公务补助</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="gonwu" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="shangbao" class="col-sm-6 control-label">大额商报</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="shangbao" value="0.00">
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
                <div class="col-lg-12 alert alert-success">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-horizontal" role="form">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" for="totalCharges">合计：</label>

                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="totalCharges" readonly="true">
                                    </div>
                                    <label class="col-sm-2 control-label" for="costs">实收：</label>

                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="costs" readonly="true">
                                    </div>
                                </div>
                                <div class="form-group" id="moneyType">
                                    <label class="col-sm-2 control-label" for="payType">支付类型：</label>

                                    <div class="col-sm-3">
                                        <select name="payType" class="form-control" id="payType">
                                            <%--<c:if test="${isMoney==1}">--%>
                                                <%--<option value="3">一卡通</option>--%>
                                            <%--</c:if>--%>
                                            <%--<c:if test="${isMoney==0}">--%>
                                                <c:forEach items="${fns:getDictList('PAY_WAY_DICT')}" var="type">
                                                    <c:choose>
                                                        <c:when test="${type.label=='现金支付'}">
                                                            <option value="${type.value}"
                                                                    selected="selected">${type.label}</option>
                                                        </c:when>
                                                        <c:otherwise>

                                                            <option value="${type.value}">${type.label}</option>
                                                        </c:otherwise>
                                                    </c:choose>
                                                </c:forEach>
                                            <%--</c:if>--%>
                                        </select>
                                    </div>
                                    <label class="col-sm-2 control-label" for="payMoney">付款：</label>

                                    <div class="col-sm-3">
                                        <input type="number" id="cashMoney" class="form-control" onchange="giveChange()" name="payMoney" id="payMoney"
                                               style="width: 120px;">
                                    </div>
                                    <%--<c:if test="${isMoney==0}">--%>
                                        <i class="fa fa-plus" style="cursor: pointer" title="增加支付类型"
                                           onclick="addType('1',this);"></i>
                                    <%--</c:if>--%>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label" for="costsMon">收款：</label>

                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="costsMon" style="width: 120px;">
                                    </div>
                                    <label class="col-sm-2 control-label" for="change">找零：</label>

                                    <div class="col-sm-3">
                                        <input type="text" class="form-control" id="change" onchange="giveChange()" style="width: 120px;" readonly="true">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
            </div>

            <div id="divide" style="display: none">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-horizontal" role="form">
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="tradeno" class="col-sm-6 control-label">交易流水号</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="tradeno" value="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="feeno" class="col-sm-6 control-label">收费单据号</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="feeno" value="">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="feeall" class="col-sm-6 control-label">费用总金额</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="feeall" value="0.00">
                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="cash " class="col-sm-6 control-label">现金支付</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="cash " value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="personcountpay " class="col-sm-6 control-label">个人账户支付</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="personcountpay " value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="mzfeeout" class="col-sm-6 control-label">医保外费用</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="mzfeeout" value="0.00">
                                        </div>

                                    </div>
                                </div>
                                <div class="col-lg-4">
                                    <div class="form-group">
                                        <label for="mzpayfirst" class="col-sm-6 control-label">本次付起付线</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="mzpayfirst" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="bcpay" class="col-sm-6 control-label">补充保险支付</label>

                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="bcpay" value="0.00">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="jcbz" class="col-sm-6 control-label">军残补助保险支付</label>
                                        <div class="col-sm-6">
                                            <input type="text" class="form-control" id="jcbz" value="0.00">
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
        </div>
     </section>
    <input type="hidden" id="isOnlyCard" value="${clinicMaster.onlyCard}">
    <input type="hidden" id="isDoctor" value="${clinicMaster.doctorOper}">
    <input type="hidden" id="isOnlyLocal" value="${clinicMaster.onlyLocal}">
    <input type="hidden" id="clinicNo1" value="${clinicMaster.clinicNo}">
    <input type="hidden" id="patientId" value="${clinicMaster.patientId}">
    <input type="hidden" id="balance" value="">
</div>
</div>
</div>